<?php

require_once('lib/LzUrl.php');

$url    = new LzUrl('http://username:passwd@hostname/path?a=A&b=B#anchor');
LzTests::ln(
        '--parts--',
        $url->toStr('&'),
        $url->scheme,
        $url->user,
        $url->pass,
        $url->host,
        $url->port,
        $url->path,
        $url->args,
        $url->args->a,
        $url->fragment,
        ''
    );

$url->user      = '';
$url->args->a   = 'AA';
unset($url->args->b);
$url->fragment  = '';
LzTests::ln(
        '--edited--',
        $url,
        ''
    );

$url->args->clear();
$url->port  = 80;
LzTests::ln(
        '--no args + port--',
        $url,
        ''
    );

$url    = new LzUrl('http://host/path/?a[0]=A&b%5Bc%5D=C');
LzTests::ln(
        '--array args--',
        $url->toStr('&amp;'),
        $url->args->a->{0},
        $url->args->b->c
    );
?>
---EXPECT---
--parts--
http://username:passwd@hostname/path?a=A&b=B#anchor
http
username
passwd
hostname

/path
a=A&b=B
A
anchor

--edited--
http://hostname/path?a=AA

--no args + port--
http://hostname:80/path

--array args--
http://host/path?a%5B0%5D=A&amp;b%5Bc%5D=C
A
C
